<template>
  <div class="app-container">
    <el-form :inline="true" label-width="80px">
      <el-form-item label="名称">
        <el-input v-model="listQuery.name" />
      </el-form-item>

      <el-form-item  label="PC/APP">
        <el-select v-model="listQuery.type" placeholder="请选择">
          <el-option label="--" value=""/>
          <el-option label="PC" value="0"/>
          <el-option label="APP" value="1"/>
        </el-select>
      </el-form-item>

      <el-form-item  label="启用/禁用">
        <el-select v-model="listQuery.able" placeholder="请选择">
          <el-option label="--" value=""/>
          <el-option label="启用" value="1"/>
          <el-option label="禁用" value="0"/>
        </el-select>
      </el-form-item>

      <el-form-item :inline="true" label="是否结束">
        <el-select v-model="listQuery.going" placeholder="请选择">
          <el-option label="--" value="" />
          <el-option label="进行中" value="1"/>
          <el-option label="已结束" value="2"/>
        </el-select>
      </el-form-item>
      <el-button type="primary" round>搜索</el-button>
    </el-form>

    <el-table :data="list" border style="width: 100%">
      <el-table-column align="center" prop="fastNavigatorName" label="名称">
        <template slot-scope="scope">
          <span>{{scope.row.fastNavigatorName}}</span>
        </template>
      </el-table-column>
      <el-table-column align="center" prop="name" label="快速导航名称">
        <template slot-scope="scope">
          <span>{{scope.row.name}}</span>
        </template>
      </el-table-column>
      <el-table-column align="center" prop="templateName" label="模板名称">
        <template slot-scope="scope">
          <span>{{scope.row.templateName}}</span>
        </template>
      </el-table-column>
      <el-table-column align="center" prop="imgPath" label="展示图">
        <template slot-scope="scope">
          <span>{{scope.row.imgPath}}</span>
        </template>
      </el-table-column>
      <el-table-column align="center" prop="type" label="PC/APP" width="80px">
        <template slot-scope="scope">
          <span>{{scope.row.type}}</span>
        </template>
      </el-table-column>
      <el-table-column align="center" prop="startAndEndTime" label="开始时间/结束时间" width="300px">
        <template slot-scope="scope">
          <span>{{scope.row.startAndEndTime}}</span>
        </template>
      </el-table-column>
      <el-table-column align="center" prop="date" label="操作">
        <template slot-scope="scope">
        <el-button type="text" @click="openEdit(scope.row)" >修改</el-button>
          <el-button type="text" @click.native="del(scope.row.id)" style="color:red" >删除</el-button>
        </template>
      </el-table-column>
      <el-table-column prop="date" label="禁/启用"></el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="listQuery.currentPage"
      :limit.sync="listQuery.showCount"
      @pagination="getList"
    />
 
     <hoemEdit ref="hoemEdit" />

  </div>
</template>

<script>
import apihomefloor from "@/api/frontManage/homefloor";
import Pagination from "@/components/Pagination";
import { confirm } from '@/utils/index';
import hoemEdit from './dialogHomeEdit'
export default {
  name: "homefloor",
  components: {Pagination,hoemEdit},
  data() {
    return {
      list: [],
      total:0,
      listQuery:{
       currentPage: 1,
       showCount: 10,
       name:"",
       type: "", 
       able: 1,
       going: 1
       }
    };
  },

  created() {
    this.getList();
  },

  methods: {
    //表单
    getList() {
     let data = apihomefloor.getHomePageFloorList()
     this.list = data.list
     this.total = data.page.totalResult
    },
    //删除
    del(id){
      confirm('是否删除').then(()=>{
        console.log('111')
      })
    },
    //修改
    openEdit(row){
      this.$refs.hoemEdit.open(row)
    }
  }
};
</script>

<style scoped>
</style>